package com.zlm.user.emp.service.impl;

import com.zlm.common.base.AbstractBaseService;
import com.zlm.common.constants.CommonConstants;
import com.zlm.user.emp.dao.SysBannerDao;
import com.zlm.common.entity.SysBannerDO;
import com.zlm.user.emp.service.SysBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: duyufu
 * @Date: 2019/4/23 15:38
 */
@Service
public class SysBannerServiceImpl extends AbstractBaseService<SysBannerDao, SysBannerDO> implements SysBannerService {

    @Autowired
    @Override
    public void setBaseDao(SysBannerDao sysBannerDao) {
        this.baseDao = sysBannerDao;
    }

    @Override
    public List<SysBannerDO> getEntityByType(Integer type) {
        List<SysBannerDO> bannerList = baseDao.getEntityByType(type);
        for (SysBannerDO sysBannerDO : bannerList) {
            sysBannerDO.setImgSrc(CommonConstants.EMP_URL.concat(sysBannerDO.getImgSrc()));
        }
        return bannerList;
    }
}
